/* 异步路由 */
import Layout from '@/layout/index.vue'

export const asyncRoutes = [
  {
    path: '/department',
    component: Layout,
    children: [{
      path: '',
      name: 'department',
      component: () => import('@/views/department/department.vue'),
      meta: { title: '组织架构', icon: 'tree' }
    }]
  },
  {
    path: '/role',
    component: Layout,
    children: [{
      path: '',
      name: 'role',
      component: () => import('@/views/role/role.vue'),
      meta: { title: '角色管理', icon: 'setting' }
    }]
  },
  {
    path: '/employee',
    component: Layout,
    children: [{
      path: '',
      name: 'employee',
      component: () => import('@/views/employee/employee.vue'),
      meta: { title: '员工管理', icon: 'people' }
    }, {
      path: 'detail/:id?',
      name: 'detail',
      component: () => import('@/views/employee/components/Detail.vue'),
      meta: { title: '员工详情' },
      hidden: true
    }]
  },
  {
    path: '/permission',
    component: Layout,
    children: [{
      path: '',
      name: 'permission',
      component: () => import('@/views/permission/permission.vue'),
      meta: { title: '权限管理', icon: 'lock' }
    }]
  },
  {
    path: '/approval',
    component: Layout,
    children: [{
      path: '',
      name: 'approval',
      component: () => import('@/views/approval/approval.vue'),
      meta: { title: '审批管理', icon: 'tree-table' }
    }]
  },
  {
    path: '/attendance',
    component: Layout,
    children: [{
      path: '',
      name: 'attendance',
      component: () => import('@/views/attendance/attendance.vue'),
      meta: { title: '考勤管理', icon: 'excel' }
    }]
  },
  {
    path: '/salary',
    component: Layout,
    children: [{
      path: '',
      name: 'salary',
      component: () => import('@/views/salary/salary.vue'),
      meta: { title: '工资管理', icon: 'money' }
    }]
  },
  {
    path: '/social',
    component: Layout,
    children: [{
      path: '',
      name: 'social',
      component: () => import('@/views/social/social.vue'),
      meta: { title: '社保管理', icon: 'table' }
    }]
  }
]
